home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000114-20000217 / 000169_news@columbia.edu _Thu Jan 27 22:58:17 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  10KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id WAA02486
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 27 Jan 2000 22:58:17 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id WAA07282
  7.     for kermit.misc@watsun.cc.columbia.edu; Thu, 27 Jan 2000 22:38:35 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: jrd@cc.usu.edu (Joe Doupnik)
  10. Subject: Re: Case Study #10: Atomic File Movement
  11. Message-ID: <nJLJ3X13aW$a@cc.usu.edu>
  12. Date: 27 Jan 00 20:26:23 MDT
  13. Organization: Utah State University
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <86qta3$2a0$1@newsmaster.cc.columbia.edu>, fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
  17. > In article <gSF8krj$2SXn@cc.usu.edu>, Joe Doupnik <jrd@cc.usu.edu> wrote:
  18. > :     A "friendly amendment." While the Kermit protocol, and TCP, do an
  19. > : acceptable job of confirming stages of work are completed, those techniques
  20. > : do not remove ambiguity. Frank correctly states "somewhat immune." Old
  21. > : packets whose sequence numbers have wrapped to the proper current value,
  22. > : badly garbled ones with apparently legit contents (CRC checks are hardly
  23. > : perfect), and packets delivered by mistake to the wrong session, are three
  24. > : serious concerns for protocol designers because they confuse the normal 
  25. > : stage by stage confirmations. TCP uses three way handshakes, extra steps
  26. > : to extend sequence numbers in some circumstances, and pseudo headers, to
  27. > : help reduce false indications. Kermit does a pretty good job too, but not
  28. > : to the extent that TCP goes. 
  29. > :     The two hill army problem remains when one gets serious about comms.
  30. > : As stated, there is no certainty in the exchange, only approximation to it.
  31. > :      
  32. > I meant to get back to this earlier, (so as not to leave an unsettling
  33. > impression with readers who don't study these topics) but better late than
  34. > never.
  35. > I believe most of Joe's observations pertain more to TCP and IP than to
  36. > Kermit:
  37. >  . Old packets whose sequence numbers have wrapped.  This can happen in
  38. >    TCP/IP because it's a worldwide packet-switched network.  A TCP packet
  39. >    (encapsulated within an IP packet) can be stuck in the network for
  40. >    minutes, hours, days, or weeks, and then show up after the sequence
  41. >    number space has recycled one or more times, and then it can cause
  42. >    trouble unless there is a higher (than TCP) level of checking.  But
  43. >    Kermit connections are either point-to-point in fact, or in effect, so
  44. >    packets don't lurk in odd crannies of the world and reappear at a later
  45. >    time -- at least not late enough to cause confusion about packet
  46. >    numbers.  Why?  Because (in the non-streaming case) every Kermit packet
  47. >    must be acknowledged.  The window can't be larger than half the
  48. >    sequence number space, and it can't advance until the oldest packet in
  49. >    the window is acknowledged.  This technique, called "sliding windows
  50. >    with selective retransmission", is more conservative and robust than
  51. >    the technique TCP uses in preventing packet sequence number ambiguity.
  52. >  . Packets are delivered by mistake to the wrong session.  Can't happen in
  53. >    Kermit because there is only one session.
  54. >  . Packets can be garbled to look like other packets.  Yes, this can
  55. >    happen in any communictions protocol with some calculable probability.
  56. >    But let's look at the consequence in the context of atomic file
  57. >    movement.  First, it is possible (but highly unlikely) that a data
  58. >    packet can be corrupted in such a way that its CRC will still be
  59. >    correct, thus allowing bad data into a file (but only if the packet
  60. >    sequence number, length, and other controls remain valid).  Of course
  61. >    this can happen in any communications protocol; there is a whole
  62. >    literature on the subject.  But what about the progress of the protocol
  63. >    itself?  Each possible happenstance and its consequences can be
  64. >    examined in turn.  For example, an ACK can turn into a NAK with the
  65. >    same sequence number.  No harm is done.  A NAK can turn into an ACK for
  66. >    the same packet.  Again, no harm is done (because the seemingly ACK'd
  67. >    packet will missing at the receiver, and this will cause the transfer
  68. >    to fail eventually.)  An ACK is turned into something besides an ACK or
  69. >    NAK: then we have an illegal packet type and the transfer fails.  An
  70. >    ACK is turned into an ACK with a different sequence number; if it's an
  71. >    "old" sequence number it is ignored and no harm is done; if it's a
  72. >    "new" one, the sender will catch the error ("You ACK'd a packet I didn't
  73. >    send").  And so on.
  74. > In other words, I think it is safe to say that the chances are practically
  75. > negligible that a Kermit transfer will appear to succeed when it failed.
  76. > Except perhaps for possible data corruption, which all protocols are subject
  77. > to; as noted in the literature, the number of errors that a CRC will not
  78. > catch is very small, and the probability that exactly such an error will
  79. > occur, out of all the kinds of errors that can occur, is much smaller still.
  80. > And in fact, in 20 years of experience with Kermit transfers, I can't recall
  81. > a single confirmed report of the protocol reporting success when the
  82. > transfer failed.
  83. > - Frank
  84. -------
  85.     Faithful readers can see an academic discussion right away. What
  86. Frank and I are doing here is exploring the outer limits of protocols
  87. to see just how close one can come to meeting a requirement that both
  88. file transmiter and receiver agree that the file has made it across intact.
  89. It's an interesting puzzle, actually, because we learn neat things about
  90. particular protocols.
  91.     Take the stray ACK arriving out of blue at the worse possible
  92. moment (masquerading as that very ACK from another session). The stray
  93. can readily happen because the comms pathway is long, such as the 
  94. Internet with its many routers and paths. Ok, so it could happen, yet
  95. it would be rare indeed to line up just so. What if it did, however.
  96. An ACK tells the transmitter to dismiss the held packet and worry about
  97. the next. The file isn't changed at this point. But the receiver has
  98. its own ideas of propriety and needs the packet which is missing but is 
  99. covered by that stray ACK. So, the receiver, being a good protocol 
  100. engine, declines to let that go unnoticed and insists upon the missing
  101. packet being filled in soon; it won't leave home without it. Whew!
  102.     A more serious stray is a data packet arriving just before the
  103. real one and the real one is rejected as a duplicate (same sequence
  104. number etc). Here we get corruption and don't know it. Bad guys like
  105. to play tricks like this with security related traffic. Such spoofing
  106. can be taken to extremes of masquerading as the real file sender or
  107. receiver, and so on.
  108.     On getting sessions muddled. The way this can happen is to
  109. run two Kermits over the same underlying transport protocol stack,
  110. say TCP/IP but it could be others. A "small mistake, fixed in the next
  111. release" could deliver a packet to the wrong Kermit. Nothing bad happens
  112. unless sequence numbers and packet kind line up just right, but in
  113. principle they might when the damage caused is greatest (someone or
  114. other's principle). Things of this kind cause rotten comms and we
  115. do something about it well before file transfers could make mistakes.
  116.     By the way, if this happens with TCP/IP then a nasty message
  117. is returned from that wrong stack and the affected session can be
  118. abruptly terminated. Kermit is forgiving and keeps on running.
  119.     Garbling packets to look like other pristine packets is much
  120. more difficult indeed, an art form almost. But it could happen.
  121.  
  122.     Of these three situations the least likely to cause trouble
  123. is the third, garbling to look nice. It's just too hard to get a good
  124. match. But there is that opening where bytes get swapped wrong in a
  125. buffer deep down in the hardware and by chance the CRC check is ok.
  126. The first kind, stray packet, is more likely, but not frequent enough to
  127. draw attention of diligent system managers. We would have to have 
  128. delays arranged just right for sequence numbers to have gone round one
  129. whole cycle. That's a lot of storage in the net, and long term storage
  130. there is very unlikely (it's tough getting short term storage, hence
  131. packet loss under congestion). The most easily arranged boo-boo is that
  132. mis-delivery with parallel Kermits, because it's a programming error
  133. (the error would happen a lot) or a hardware glitch (much less likely).
  134. Even then things would have to line up just so to make a difference.
  135.     What I am saying is, guarantees can't be absolute. They are
  136. normally very very good indeed, but not absolute. Making a typing
  137. error denoting the file of interest is vastly more likely to occur,
  138. not to mention all the errors going into making the file and reading
  139. it later (given today's standards in programming, sigh).
  140.     If you are wondering if the Kermit protocol is more immune to
  141. these things than say TCP/IP. The answer is, I do believe, Kermit is 
  142. more robust than TCP/IP; it has slightly fewer windows of opportunity.
  143.     Frank is saying the same things, but he is trying to be more
  144. reassuring. Fine. What I am saying is absolute certainty is unobtainable,
  145. no matter where one chooses to draw the line over which data flows.
  146. Please do check your SCSI bus and RAID controller cache memory, and
  147. type more carefully next time.
  148.     Now wasn't that educational? I thought so; rather fun too.
  149.     Joe D.